<?php

/**
 * SfGuardUserProfile filter form base class.
 *
 * @package    SAC_CLonsa
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseSfGuardUserProfileFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'user_id'   => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => true)),
      'nombres'   => new sfWidgetFormFilterInput(),
      'apellidos' => new sfWidgetFormFilterInput(),
      'cargo'     => new sfWidgetFormFilterInput(),
      'area_id'   => new sfWidgetFormPropelChoice(array('model' => 'Area', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'user_id'   => new sfValidatorPropelChoice(array('required' => false, 'model' => 'sfGuardUser', 'column' => 'id')),
      'nombres'   => new sfValidatorPass(array('required' => false)),
      'apellidos' => new sfValidatorPass(array('required' => false)),
      'cargo'     => new sfValidatorPass(array('required' => false)),
      'area_id'   => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Area', 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_profile_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SfGuardUserProfile';
  }

  public function getFields()
  {
    return array(
      'id'        => 'Number',
      'user_id'   => 'ForeignKey',
      'nombres'   => 'Text',
      'apellidos' => 'Text',
      'cargo'     => 'Text',
      'area_id'   => 'ForeignKey',
    );
  }
}
